package com.home.s2g.display;

import com.home.s2g.entities.Player;

import javax.swing.*;
import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * User: Zinolis
 * Date: 12/17/11
 * Time: 6:37 PM
 * To change this template use File | Settings | File Templates.
 */
public class MainFrame {
    private static MainFrame instance;

    public static MainFrame getInstance() {
        if (instance == null) {
            instance = new MainFrame();

        }
        return instance;
    }

    private void init() {
        frame = new JFrame();
        frame.setSize(800, 600);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }

    private JFrame frame;


    private MainFrame() {
    }

    private class DisplayPanel extends JPanel {

        private Player player;
        private Painter painter;

        public void init() {
            painter = new Painter();
        }

        @Override
        protected void paintComponent(Graphics g) {
            painter.drawObject((Graphics2D) g, player);
        }
    }
}
